#/usr/bin/python
# coding: utf8


import time
from  PAM30 import PAM30
import winsound
import sys
import win32api
import win32con


def lgTaobao(username, userpass):
    lgurl = 'https://login.taobao.com/member/login.jhtml?spm=2013.1.0.2'
    ie.navigate(lgurl)
    ie.setTextBox('TPL_username', username)
    ie.setCheckBox('J_SafeLoginCheck', 0)
    ie.setTextBox('TPL_password', userpass)
    time.sleep(1)
    ie.clickButton('J_SubmitStatic')
    time.sleep(1)
    if(ie.findText(username)):
        return True
    else:
        return False
    
    
ie= PAM30.PAMIE()
username = '长胡子的小羊'
userpass = 'tq3jx8'
if(lgTaobao(username, userpass)):
    print 'OK'
else:
    print 'buok'